Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / View-Related Objects Reference
View Device Functions / Creating and Manipulating View Device Objects


GXCopyToViewDevice

You can use the GXCopyToViewDevice function to create a copy of an existing view device object.

gxViewDevice GXCopyToViewDevice  (gxViewDevice target, 
                                  gxViewDevice source);
target
A reference to the view device to copy the source contents into. If you specify nil for this parameter, the GXCopyToViewDevice function creates a new view device object.
source
A reference to the view device whose contents you want to copy.
function result
A reference to the view device that is a copy of the source view device.
DESCRIPTION
The GXCopyToViewDevice function copies the contents of an existing view device object to another, or it creates a new view device object and copies the contents of an existing view device object to it. The function copies the clip, mapping, bitmap shape (including color space, color profile reference, and color set reference), attributes, and tag list from the source view device. It clones, but does not copy, the tag objects in the tag list.

In copying the bitmap, the GXCopyToViewDevice function does not copy the pixel image itself, just the properties of the bitmap shape. For the color set and color profile properties of the bitmap, and tag objects, GXCopyToViewDevice copies only the references, not the objects themselves.

If you specify nil for the target parameter, the GXCopyToViewDevice function creates a new view port object and copies the properties of the source view device into it.

SPECIAL CONSIDERATIONS
If you attempt to copy to a screen device, this function posts a viewDevice_access_restricted error.

If you specify nil for the target parameter and no error occurs, the GXCopyToViewDevice function creates a view device object; you are responsible
for disposing of that object when you no longer need it.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
invalid_viewDevice_reference 
viewDevice_access_restricted(debugging version)
SEE ALSO
To create a new view device that has default properties instead of being a copy of an existing view device, use the GXNewViewDevice function, described on page 7-98.

To compare two view device objects for equality, use the GXEqualViewDevice function, described next.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help